class DataBaseConfig(object):
   def __init__(self,desc):
       self.desc = desc

   def get_connect_url(self):
       pass

class MysqlDataBaseConfig(DataBaseConfig):
    def __init__(self, host, port, database, username, password,desc,charset='utf8'):
        super().__init__(desc)
        self.host = host
        self.port = port
        self.database = database
        self.username = username
        self.password = password
        self.charset = charset
    def get_connect_url(self):
        return "mysql+pymysql://{username}:{password}@{host}:{port}/{database}".format(username=self.username, password=self.password,host=self.host, port=self.port, database=self.database)

class SqliteDataBaseConfig(DataBaseConfig):
    def __init__(self, address,desc):
        super().__init__(desc)
        self.address = address
    def get_connect_url(self):
        return "sqlite:///{database_path}".format(address=self.address)


class PostgresqlDataBaseConfig(DataBaseConfig):
    def __init__(self, host, port, database, username, password,desc, charset='utf8'):
        super().__init__(desc)
        self.host = host
        self.port = port
        self.database = database
        self.username = username
        self.password = password
        self.charset = charset
    def get_connect_url(self):
        return "postgresql://{username}:{password}@{host}:{post}/{database}".format(username=self.username, password=self.password,host=self.host, port=self.port, database=self.database)



mysql_database_001 = MysqlDataBaseConfig("192.168.50.103", 3306, "database1", "root", "root","虚拟机测试库1")
mysql_database_002 = MysqlDataBaseConfig("192.168.50.103", 3306, "database2", "root", "root","虚拟机测试库1")
mysql_database_003 = MysqlDataBaseConfig("172.16.182.23", 30006, "budget_2024", "develop", "nZNBHaw86dzGGRFj","开发预算库")
mysql_database_004 = MysqlDataBaseConfig("172.16.182.21", 3306, "apaasdb_user", "develop", "nZNBHaw86dzGGRFj","开发用户库")
mysql_database_local = MysqlDataBaseConfig("127.0.0.1", 3306, "base-project", "root", "root","本地")
mysql_database_bzx = MysqlDataBaseConfig("192.168.2.50", 3306, "bzx_service_2000", "boss_db", "BossAdmin.1","博智星")

sqlite_database_001 = SqliteDataBaseConfig("D:\\vscode-workspace\\account-manager\\public\\database\\account.db","本地")

